import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

// Vuex 持久化  
import createPersistedState from "vuex-persistedstate";   // localStorage 
import { ajax } from './../api/index';


export default new Vuex.Store({
  plugins:[
    createPersistedState()
],
  state: {
    cartNum:9,
    userInfo:null, // 用户信息 判断是否登录 
    fromName:"",
 
  },
  mutations: {
    changeUserInfo(state,payload){
      state.userInfo = payload;
    },
    changeFromName(state,payload){
      state.fromName=payload;
    }
  },
  actions: {
  },
  modules: {
  }
})
